package com.zmc.lostfound.search.controller;

import com.zmc.lostfound.common.utils.Result;
import com.zmc.lostfound.search.service.UserSearchService;
import com.zmc.lostfound.search.vo.SearchResult;
import com.zmc.lostfound.search.vo.UserSearchVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ZMC
 * @description 用户信息搜索接口
 * @email 2869581855@qq.com
 * @date 2023-07-05 15:09:50
 */
@RestController
@RequestMapping("/user")
@Api(value = "用户信息搜索接口", tags = "用户信息搜索接口")
public class UserSearchController {

    private final UserSearchService userSearchService;

    public UserSearchController(UserSearchService userSearchService) {
        this.userSearchService = userSearchService;
    }

    @ApiOperation("多条件搜索用户基本信息")
    @GetMapping("/search/baseInfo")
    public Result searchBaseInfo(@Validated UserSearchVO userSearchVO) {
        SearchResult searchResult = userSearchService.searchBaseInfo(userSearchVO);
        return Result.ok("查询成功").put("searchResult", searchResult);
    }

}
